package com.wz.project.util;

import java.util.Calendar;
import java.util.Date;

/**
 * @author zn kai
 * @create 2020-03-05 18:44
 */
public class StringUtil {

    //String 去前面0
    public static String Stringdel(String str) {
        String[] split = str.split("");
        String res = "";
        for (int i =0;i <split.length ; i++){
            if (!"0".equals(split[i])){
                res = str.substring(i,split.length);
                break;
            }
        }
        return res;
    }
    //String 前面加0
    public static String Stringadd(String str) {
        String  ss = "000000000000000000";

        if(str.length()<18){
            str = ss.substring(0,(ss.length()-str.length()))+str;
        }
        return str;
    }

    public static String Stringadd12(String str) {
        String  ss = "000000000000";

        if(str.length()<12){
            str = ss.substring(0,(ss.length()-str.length()))+str;
        }
        return str;
    }

    public static void main(String[] args) {
        System.out.println(Stringdel("000000000510403053"));

        String fbarcode = "1013398979664";
        System.out.println(fbarcode.substring(0,13));
    }
}
